import request from '@/utils/request'

// 通用组织树结构
export function getDeptTreeApi(params = {}) {
  return request.get('/system/sysOrg/getTree', { params })
}

// 获取组织树列表
export function getTreeByEntityApi(params = {}) {
  return request.get('/system/sysOrg/getTreeByEntity', { params })
}

// 添加部门
export function addDeptApi(params = {}) {
  return request.post('/system/sysOrg', params)
}

// 修改部门
export function modifyDeptApi(params = {}) {
  return request.put('/system/sysOrg', params)
}

// 删除部门
export function deleteDeptApi(params = {}) {
  return request.delete(`/system/sysOrg/${params.id}`)
}
